package sn.gandal.mobile.kalpet.server.dto;


import java.io.IOException;

import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;


public class Json2JavaParser {
	
	public static AuthDTO parseToAccount (String jsonAccountText){
		AuthDTO authData=null;
		ObjectMapper mapper= new ObjectMapper();
		try {
			authData= mapper.readValue(jsonAccountText, AuthDTO.class);
			
		} catch (JsonParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (JsonMappingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return authData;
		
	}

}
